package com.whenjun.controller;

import com.alibaba.fastjson.JSONObject;
import com.ifootbook.util.common.BackJson;
import com.ifootbook.util.common.CallResult;
import com.whenjun.common.LoggerParent;
import com.whenjun.service.core.RecService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: shirley
 * @Date: 2022/2/13 14:16
 * @Description:
 */
@RequestMapping("rec")
@RestController
@Api(tags = "ISC事件接受")
public class RecController extends LoggerParent {

    @Autowired
    private RecService recService;

    @PostMapping("eventRcv")
    @ApiOperation("事件接受")
    public CallResult<?> rec(@RequestBody JSONObject jsonObject){
        log.info("eventRcv_json:" + JSONObject.toJSONString(jsonObject));
        recService.eventDeal(jsonObject);
        return BackJson.success();
    }
}
